<!DOCTYPE html>
<html>
    <head>
        <title>Travelbook</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="css/notlogged.css" rel="stylesheet" />
    </head>
    <body>
        <div id="bodycolor">
            <div id="header">
                <form id="login" action="login.php" method="post">
                    Username: <input type="text" name="username" />
                    Password: <input type="password" name="password" />
                    <input type="submit" value="Login" />
                </form>
                <?php
                    if(isset($_GET['error'])){
                        if($_GET['error'] == 1){
                            echo "<p class=loginErr> Τα στοιχεία σας είναι λάθος.</p>";
                        }
                    }
                ?>
            
                <p> or <a href="registration.php">register</a> an account and start your trip! </p>
            </div>
            <h1>Νεότερα ταξίδια</h1>
                <div id="recentTrips">

                    <?php
                       include 'DAO/TripDAO.class.php';
                       include 'Classes/TripsTemplate.class.php';
                       $tripDao = new TripDAO();
                       // Pairnoume ta taksidia apo th bash
                       $trips = $tripDao->getRecentTrips();
                       // Dhmioyrgoume thn html
                       $tripsTemplate = new TripsTemplate();
                       $tripsTemplate($trips);
                    ?>
                </div>
        </div>
       
    </body>
</html>